package com.ai.feign;

import com.ai.domain.pojo.Course;
import com.ai.domain.vo.CourseVo;
import com.ai.domain.vo.PurchasedCourseVo;
import com.common.domain.pojo.Result;
import com.common.feign.OpenFeignRequestPrefix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "eselect-course-service")
public interface CourseFeignClient {

    // 获取指定用户id购买的课程
    @GetMapping(OpenFeignRequestPrefix.COURSE_SERVICE + "/purchased")
    Result<List<PurchasedCourseVo>> getCourseListBuyByUserId(@RequestParam("userId") Long userId);

    // 根据用户名获取该用户发布的全部课程
    @GetMapping(OpenFeignRequestPrefix.COURSE_SERVICE + "/listByUsername")
    Result<List<CourseVo>> getCourseListPublishByUsername(@RequestParam("username") String username);

    // 根据课程唯一标识获取课程信息
    @GetMapping(OpenFeignRequestPrefix.COURSE_SERVICE + "/infoByUniqueIdentification")
    Result<Course> getCourseInfoByUniqueIdentification(@RequestParam("UniqueIdentification") Object UniqueIdentification);


}
